package com.spsoft.dmzeinvoice.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 特定要素枚举类
 *
 * @author : chenxudong
 * @date : 2024/2/29 10:45
 */
@Getter
@AllArgsConstructor
public enum TdysEnum {

    TDYS_01("01", "成品油发票"),
    TDYS_02("02", "稀土发票"),
    TDYS_03("03", "建筑服务发票"),
    TDYS_04("04", "货物运输服务发票"),
    TDYS_05("05", "不动产销售服务发票"),
    TDYS_06("06", "不动产租赁服务发票"),
    TDYS_07("07", "代收车船税"),
    TDYS_08("08", "通行费"),
    TDYS_09("09", "旅客运输服务发票"),
    TDYS_10("10", "医疗服务（住院）发票"),
    TDYS_11("11", "医疗服务（门诊）发票"),
    TDYS_12("12", "自产农产品销售发票"),
    TDYS_13("13", "拖拉机和联合收割机发票"),
    TDYS_14("14", "机动车"),
    TDYS_15("15", "二手车"),
    TDYS_16("16", "农产品收购发票"),
    TDYS_17("17", "光伏收购发票"),
    TDYS_18("18", "卷烟发票");

    private final String code;
    private final String name;

    // 根据code获取name
    public static String getNameByCode(String code){
        if (code == null) {
            return null;
        }
        for (TdysEnum status : TdysEnum.values()) {
            if(status.getCode().equals(code)){
                return status.getName();
            }
        }
        return null;
    }
}
